package com.byteshake.ddoffice.model.respository

import com.byteshake.common.base.BaseData
import com.byteshake.common.base.BaseRepository
import com.byteshake.ddoffice.model.http.WanRetrofitClient
import com.byteshake.ddoffice.model.http.api.WanApi
import com.byteshake.ddoffice.model.bean.Article
import com.byteshake.ddoffice.model.bean.Banner


class HomeRepository : BaseRepository() {

    private val service = WanRetrofitClient.getService(WanApi::class.java)

    suspend fun requestWanData(): BaseData<List<Banner>> {
        return executeRequest { service.getBanner() }
    }

    suspend fun requestRankData(page: Int): BaseData<Article> {
        return executeRequest { service.getArticle(page) }
    }
}